package com.slkj.shilixiaoyuanapp.entity.Enum;

import com.slkj.shilixiaoyuanapp.R;

/**
 * Created  on 2018-09-05
 *
 * @author 唐开阔
 * @describe /*
 * type--1--申诉
 * type--2--物品领取
 * type--3--采购
 * type--4--报销
 * type--5--出差
 * type--6--请假
 * type--7--议题
 * type--8--公章
 * type--9--报修
 * type--10--艺体特长
 * type--11--学生请假
 * type--12--通知详情
 */


public enum AdministrationToolType {
    SS("申诉", 1, R.drawable.tool_clockin),
    WPLY("物品领用", 2,R.drawable.tool_stationery),
    CG("采购", 3,R.drawable.tool_purchase),
    BX("报销", 4,R.drawable.tool_bill),
    CC("出差", 5,R.drawable.tool_plane),
    QJ("请假", 6,R.drawable.tool_vacation),
    YT("议题", 7,R.drawable.tool_meeting),
    GZ("公章", 8,R.drawable.tool_cachet),
    BXIU("报修", 9,R.drawable.tool_bx),
    YTTC("艺体特长", 10,R.drawable.ballet),
    XSQJ("学生请假", 11,R.drawable.tool_vacation),
    TZXQ("通知详情", 12),
    XYHD("校外活动",14,R.drawable.balloons),;
    public String name;
    public int type;
    public int iconRes;

    AdministrationToolType(int type) {
        this.setName(name);
        this.setType(type);
    }

    AdministrationToolType(String name, int type) {
        this.setName(name);
        this.setType(type);
        this.iconRes = -1;

    }

    AdministrationToolType(String name, int type, int iconRes) {
        this.name = name;
        this.type = type;
        this.iconRes = iconRes;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getIconRes() {
        return iconRes;
    }

    public void setIconRes(int iconRes) {
        this.iconRes = iconRes;
    }

    // 根据value返回枚举类型,主要在switch中使用
    public static AdministrationToolType getByValue(int value) {
        for (AdministrationToolType code : values()) {
            if (code.getType() == value) {
                return code;
            }
        }
        return null;
    }
}
